package com.vcredit.creditcat.web;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.vcredit.creditcat.model.ChannelBusinessStatus;
import com.vcredit.creditcat.service.ChannelBusinessStatusService;
import com.vcredit.creditcat.framework.pagination.Page;
 /*
  * @author liaoshengjun
  * @version 1.0
  * @since 1.0
 */
@RestController
@RequestMapping("/channelBusinessStatus")
public class ChannelBusinessStatusController extends BaseController {
    
    @Autowired
    private ChannelBusinessStatusService channelBusinessStatusService;
  
    @RequestMapping(value = "/list")
    public ModelAndView  showPageChannelBusinessStatus(HttpServletRequest request) {
        return new ModelAndView("channelbusinessstatus/channelBusinessStatusList");
    }  
	
	@RequestMapping(value = "/listChannelBusinessStatus", method = RequestMethod.GET)
	public Page<ChannelBusinessStatus> findByPageChannelBusinessStatus(HttpServletRequest request) {
      return channelBusinessStatusService.findByPage(makeDefaultCriteria(request));
	}
	
	@RequestMapping(value = "/saveChannelBusinessStatus", method = RequestMethod.POST)
	public String saveChannelBusinessStatus(@RequestBody ChannelBusinessStatus channelBusinessStatus,HttpServletRequest request) {
	    channelBusinessStatusService.save(channelBusinessStatus);
		return SUCCESS;
	}
	   
    @RequestMapping(value = "/updateChannelBusinessStatus", method = RequestMethod.PUT)
    public String updateChannelBusinessStatus(@RequestBody ChannelBusinessStatus channelBusinessStatus,HttpServletRequest request) {
        channelBusinessStatusService.update(channelBusinessStatus);
        return SUCCESS;
    }
    
    @RequestMapping(value = "/removeChannelBusinessStatus", method = RequestMethod.DELETE)
    public String removeChannelBusinessStatus(@RequestParam("ids") String ids ,HttpServletRequest request) {
        channelBusinessStatusService.removeChannelBusinessStatus(ids);
        return SUCCESS;
    }	
}
